package model;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;

import com.xgggh.redpack.BR;

public class Loading extends BaseObservable implements Parcelable {
    public static final int INIT=0;
    public static final int EMPTY=1;
    public static final int ERROR=2;
    public static final int LOADING=3;
    public static final int FINISH=4;
    private int status=INIT;
    @Bindable
    public int getStatus() {
        return status;
    }
    public void setStatus(int status) {
        this.status = status;
        notifyPropertyChanged(BR.status);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.status);
    }

    public Loading() {
    }

    protected Loading(Parcel in) {
        this.status = in.readInt();
    }

    public static final Parcelable.Creator<Loading> CREATOR = new Parcelable.Creator<Loading>() {
        @Override
        public Loading createFromParcel(Parcel source) {
            return new Loading(source);
        }

        @Override
        public Loading[] newArray(int size) {
            return new Loading[size];
        }
    };
}
